]> dgit.raspbian.org Git - gnome-shell.git/commit
errorUtils: Add logErrorUnlessCancelled() helper
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 Oct 2025 00:59:20 +0000 (02:59 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 24 Oct 2025 15:37:15 +0000 (15:37 +0000)
commitb4b739dc5193cab1e6fc48ce1e9d631a7aa2c1f0
tree3ac872e373ce8996511374353b65ab3c0104a112
parent906d187f0fbbebc11638ca0209ad247efc2ef399
errorUtils: Add logErrorUnlessCancelled() helper

It is quite common to handle errors by ignoring them in case of
CANCELLED, and otherwise log them via logError().

Add a small helper method that implements that behavior, including
if the original error is wrapped in a Gio.DBusError.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3927>
js/misc/errorUtils.js
tests/meson.build
tests/unit/errorUtils.js [new file with mode: 0644]